package com.atguigu.tingshu.user.strategy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class StrategyFactory {
    @Autowired
    private Map<String, ItemTypeStrategy> strategyMap;

    public ItemTypeStrategy getStrategy(String itemType){
        ItemTypeStrategy itemTypeStrategy = strategyMap.get(itemType);

        System.out.println("----------------------："+itemTypeStrategy);
        return itemTypeStrategy;
    }
}
